home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-08-18 | 1.7 KB | 84 lines | [TEXT/R*ch] |
- #!/bin/sh
-
- stdlib=LIBDIR
- mosmlbin=BINDIR
-
- linkalso=true
- includes=""
- compopt=""
- linkopt=""
- custom=""
- linkfiles=""
- cc=gcc
- ccfiles=""
- cclib=""
- ccopt=""
- linkout=a.out
-
- while : ; do
- case $1 in
- "")
- break;;
- *.sml)
- $mosmlbin/camlrunm $stdlib/mosmlcmp -stdlib $stdlib $includes $compopt $1 || exit $?
- linkfiles="$linkfiles $1";;
- *.sig)
- $mosmlbin/camlrunm $stdlib/mosmlcmp -stdlib $stdlib $includes $compopt $1 || exit $?
- ;;
- *.uo)
- linkfiles="$linkfiles $1";;
- -c)
- linkalso=false;;
- -I|-include)
- includes="$includes -I $2"
- shift;;
- -P|-perv)
- compopt="$compopt -P $2"
- linkopt="$linkopt -P $2"
- shift;;
- -q|-quotation)
- compopt="$compopt $1";;
- -i)
- compopt="$compopt $1"
- linkopt="$linkopt $1";;
- -g|-debug)
- compopt="$compopt $1"
- linkopt="$linkopt $1";;
- -noheader)
- linkopt="$linkopt $1";;
- -noautolink)
- linkopt="$linkopt $1";;
- -o|-exec)
- linkout=$2
- shift;;
- -stdlib)
- stdlib=$2
- shift;;
- -v|-version)
- echo "The Moscow ML system, version 1.42"
- echo " (standard library from $stdlib)"
- $mosmlbin/camlrunm -V
- $mosmlbin/camlrunm $stdlib/mosmlcmp -version
- $mosmlbin/camlrunm $stdlib/mosmllnk -version;;
- -imptypes)
- compopt="$compopt $1";;
- -valuepoly)
- compopt="$compopt $1";;
- -files)
- linkfiles="$linkfiles $1 $2"
- shift;;
- -*)
- echo "Unknown option \"$1\", ignored" >&2;;
- *)
- echo "I don't know what to do with file \"$1\", ignored" >&2;;
- esac
- shift
- done
-
- if $linkalso && test -n "$linkfiles"; then
- $mosmlbin/camlrunm $stdlib/mosmllnk -stdlib $stdlib $includes $custom $linkopt \
- -exec $linkout $linkfiles || exit $?
- fi
-
- exit 0
-